﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AJWPFAdmin.Services
{
    public class CacheConfig<TEntity> : ICacheConfig<TEntity> where TEntity : class
    {
        /// <summary>
        /// 完整名称
        /// </summary>
        public string TypeHashID { get; private set; } = typeof(TEntity).FullName;


        /// <summary>
        /// 获取实体List缓存CacheKey
        /// </summary>
        /// <returns></returns>
        public string GetListCacheKey() => $"List:{TypeHashID}";

        /// <summary>
        /// 获取实体缓存CacheKey
        /// </summary>
        /// <returns></returns>
        public string GetEntityCacheKey() => $"Entity:{TypeHashID}";

        /// <summary>
        /// 获取string缓存CacheKey
        /// </summary>
        /// <returns></returns>
        public string GetStringCacheKey() => $"String:{TypeHashID}";

    }
}
